package com.woniuxy.controller;

import com.woniuxy.entity.RbacManager;
import com.woniuxy.service.RbacManagerServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 佘赛飞
 * @create 2021-11-24 12:55 下午
 */
@RestController
public class RbacManagerController {
    @Autowired
    RbacManagerServcie rbacManagerServcie;
    @RequestMapping("/findAll")
    public List <RbacManager> findAll(){
       return rbacManagerServcie.findAll();
    }
    @RequestMapping("/addManager")
    public Integer addManager(@RequestBody RbacManager rbacManager){
       return rbacManagerServcie.addManager(rbacManager);
    }
    @RequestMapping("/updateManager")
    public Integer updateManager(@RequestBody RbacManager rbacManager){
        return rbacManagerServcie.Update(rbacManager);
    }
    @RequestMapping("/deleteManager")
    public void deleteManager(@RequestBody RbacManager rbacManager){
       rbacManagerServcie.deleteManager(rbacManager);
    }

    //错误
    /*@RequestMapping("/deleteManager")
    public void deleteManager(@RequestBody String id){
        rbacManagerServcie.deleteManager(id);
    }*/

    /*@DeleteMapping("/deleteManager/{id}")
    public void deleteManager(@PathVariable String id){
        rbacManagerServcie.deleteManager(id);
    }*/
}
